import { get, post, postUpload, postFormData } from '@/utils/request'

// 上传
export const uploadFile = (file) => postUpload('/zhmsbg/common/interface/upload_img', file)
export const importFile = (url, file) => postUpload('/zhmsbg' + url, file)
export const exportFile = (url) => get('/zhmsbg' + url)

export const home_static = () => get('/zhmsbg/notice/countNotice')

// 区域
export const area_list = () => get('/zhmsbg/ZHProject/areaList')
/**
 * 本地项目
 */
export const http_project1 = {
  page: (params) => postFormData('/zhmsbg/htLocalProject/queryByPage', params),
  delete: (id) => post('/zhmsbg/htLocalProject/deleteById', { id }),
  read: (params) => get('/zhmsbg/htLocalProject/queryById', params),
  create: (params) => post('/zhmsbg/htLocalProject/add', params),
  update: (params) => post('/zhmsbg/htLocalProject/edit', params),
  rel: (params) => post('/zhmsbg/htLocalProject/relation', params),
  // 项目性质
  getProjectNature: () => post('/zhmsbg/ProjectCenter/getProjectNature'),
  // 项目类别
  gettypeList: (type) => get('/zhmsbg/htLocalProject/queryTypeList', { type })
}

/**
 * 3.0项目
 */
export const http_project2 = {
  page: (params) => postFormData('/zhmsbg/ZHProject/getOnlinePage', params),
  delete: (id) => post('/zhmsbg/ZHProject/delLabel', { id }),
  read: (params) => get('/zhmsbg/ZHProject/getDateByid', params),
  export: (params) => get('/zhmsbg/ZHProject/GetInfo', params),
  createTag: (params) => post('/zhmsbg/ZHProject/addLabel', params),
  deleteTag: (params) => post('/zhmsbg/ZHProject/delLabel', params),
  relTagList: (params) => get('/zhmsbg/ZHProject/getlabelList', params),
  tagList: () => get('/zhmsbg/label/queryList'),
  cailiaoPage: (params) => postFormData('/zhmsbg/ZHProject/getProMatterPage', params),
  piwenPage: (params) => postFormData('/zhmsbg/ZHProject/getProApprovalPage', params),
  codeList: (params) => post('/zhmsbg/workManger/getWorkLogsPage', { params }),
  geturl: (params) => get(params)

}
/**
 * 基础事项配置
 */ 
export const http_basic_event = {
  page: (params) => postFormData('/zhmsbg/ProjectMatterConfig/getMatter', params)
}
/**
 * 项目事项
 */
export const http_project_event_template = {
  page: (params) => postFormData('/zhmsbg/ProjectMatterConfig/getProcess', params),
  getNodes: (params) => postFormData('/zhmsbg/flowLayout/specificMatters/query', params),
  create: (params) => post('/zhmsbg/ProjectMatterConfig/addProcess', params),
  updateEvent: (params) => post('/zhmsbg/flowLayout/specificMatters/save', params)
}

/**
 * 项目流程模版
 */
export const http_project_process_template = {
  getCategory: (params) => postFormData('/zhmsbg/ProjectProcessConfig/getFatherProcess', params),
  page: (params) => postFormData('/zhmsbg/ProjectProcessConfig/getProcess', params),
  getNodesByCategory: (params) => postFormData('/zhmsbg/flowLayout/specificMatters/query', params),
  read: (params) => postFormData('/zhmsbg/flowLayout/templateMatters/query', params),
  create: (params) => post('/zhmsbg/ProjectProcessConfig/addProcess', params),
  updateCanvas: (params) => post('/zhmsbg/flowLayout/templateMatters/save', params)
}

/**
 * 项目流程配置
 */
export const http_project_process = {
  read: (params) => postFormData('/zhmsbg/flowLayout/projectMatters/query', params),
  updateCanvas: (params) => post('/zhmsbg/flowLayout/projectMatters/save', params)
}
/**
 * 国有资产
 */
export const http_assets = {
  page: (params) => postFormData('/zhmsbg/estate/getEstatePageList', params),
  delete: (id) => post('/zhmsbg/estate/deleteEstate', { id }),
  read: (id) => postFormData('/zhmsbg/estate/getEstateDetail', { id }),
  create: (params) => post('/zhmsbg/estate/addEstate', params),
  update: (params) => post('/zhmsbg/estate/updateEstate', params),
  nodeList: () => postFormData('/zhmsbg/estate/getDataDictionaryList', { type: 1 }),
  categoryList: () => get('/zhmsbg/estate/getCategoryList'),
  export: () => get('/zhmsbg/exportData/downloadAssetEstate'),
  import: () => postUpload('/zhmsbg/importData/uploadEstate'),
  // 补办进度
  itemPage: (assetId) => postFormData('/zhmsbg/estate/getEstateProgressPageList', { assetId }),
  item_create: (params) => post('/zhmsbg/estate/addEstateProgress', params),
  item_update: (params) => post('/zhmsbg/estate/updateEstateProgress', params),
  item_delete: (id) => post('/zhmsbg/estate/deleteEstateProgress', { id })
}
/**
 * 工作记录
 */
export const http_project_log = {
  page: (params) => postFormData('/zhmsbg/workManger/getWorkLogsPage', params)
}
/**
 * 精准帮办
 */
export const http_accurate = {
  common: {
    page: (params) => postFormData('/zhmsbg/htConsulting/queryByPage', params),
    delete: (id) => post('/zhmsbg/htConsulting/deleteById', { id }),
    read: (params) => get('/zhmsbg/htConsulting/queryById', params),
    answer: (data) => post('/zhmsbg/htConsulting/addAn', data),
    updateStatus: (params) => post('/zhmsbg/htConsulting/updateStatus', params)
  },
  plan: {
    page: (params) => postFormData('/zhmsbg/htChange/queryByPage', params),
    delete: (id) => post('/zhmsbg/htChange/deleteById', { id }),
    read: (params) => get('/zhmsbg/htChange/queryById', params)
  },
  line: {
    page: (params) => postFormData('/zhmsbg/htGuaranty/queryByPage', params),
    delete: (id) => post('/zhmsbg/htGuaranty/deleteById', { id }),
    read: (params) => get('/zhmsbg/htGuaranty/queryById', params)
  },
  accurate: {
    page: (params) => postFormData('/zhmsbg/accurate/getAccuratePageList', params),
    delete: (id) => postFormData('/zhmsbg/accurate/deleteAccurate', { id }),
    read: (params) => postFormData('/zhmsbg/accurate/getAccurateDetail', params)
  }
}

/**
 * 帮办风采
 */
export const http_elegant = {
  page: (params) => postFormData('/zhmsbg/assistantStyle/queryByPage', params),
  delete: (id) => post('/zhmsbg/assistantStyle/deleteById', { id }),
  read: (params) => get('/zhmsbg/assistantStyle/queryById', params),
  create: (params) => post('/zhmsbg/assistantStyle/add', params),
  update: (params) => post('/zhmsbg/assistantStyle/edit', params),
  updateStatus: (params) => post('/zhmsbg/assistantStyle/updateStatus', params)
}

/**
 * 政策推荐
 */
export const http_policy = {
  page: (params) => postFormData('/zhmsbg/htPolicyInfo/queryByPage', params),
  delete: (id) => post('/zhmsbg/htPolicyInfo/deleteById', { id }),
  read: (params) => get('/zhmsbg/htPolicyInfo/queryById', params),
  create: (params) => post('/zhmsbg/htPolicyInfo/add', params),
  update: (params) => post('/zhmsbg/htPolicyInfo/edit', params),
  updateStatus: (params) => post('/zhmsbg/htPolicyInfo/updateStatus', params)
}

/**
 * 用户疑问
 */
export const http_userqs = {
  page: (params) => postFormData('/zhmsbg/userProblem/queryByPage', params),
  delete: (id) => post('/zhmsbg/userProblem/deleteById', { id }),
  read: (params) => get('/zhmsbg/userProblem/queryById', params),
  updateStatus: (params) => post('/zhmsbg/userProblem/updateStatus', params),
  answer: (data) => post('/zhmsbg/userProblem/addAn', data)
}

/**
 * 操作指南
 */
export const http_approval1 = {
  page: (params) => postFormData('/zhmsbg/htApprovalCourse/queryByPage', params),
  delete: (id) => post('/zhmsbg/htApprovalCourse/deleteById', { id }),
  read: (params) => get('/zhmsbg/htApprovalCourse/queryById', params),
  create: (params) => post('/zhmsbg/htApprovalCourse/add', params),
  update: (params) => post('/zhmsbg/htApprovalCourse/edit', params),
  updateStatus: (params) => post('/zhmsbg/htApprovalCourse/updateStatus', params)
}

export const http_approval2 = {
  page: (params) => postFormData('/zhmsbg/htPlainRub/queryByPage', params),
  delete: (id) => post('/zhmsbg/htPlainRub/deleteById', { id }),
  read: (params) => get('/zhmsbg/htPlainRub/queryById', params),
  create: (params) => post('/zhmsbg/htPlainRub/add', params),
  update: (params) => post('/zhmsbg/htPlainRub/edit', params),
  updateStatus: (params) => post('/zhmsbg/htPlainRub/updateStatus', params)
}
/**
 * 事项管理
 */
export const http_event = {
  page: (params) => postFormData('/zhmsbg/htProjectProgress/queryByPage', params),
  detail: (params) => post('/zhmsbg/htProjectProgress/queryById', params)
}
/**
 * 绩效考核管理
 */
export const http_performance = {
  page: (params) => postFormData('/zhmsbg/htAchievements/queryByPage', params),
  read: (params) => get('/zhmsbg/htAchievements/queryById', params),
  scoreList: (params) => get('/zhmsbg/htAchievements/getScoreList', params),
  updateRules: (params) => post('/zhmsbg/htAchievements/editRules', params),
  readRules: () => get('/zhmsbg/htAchievements/getRules')
}

/**
 * 会商会审
 */
export const http_audit = {
  page: (params) => postFormData('/zhmsbg/jointDiscussions/queryByPage', params),
  read: (params) => get('/zhmsbg/jointDiscussions/queryById', params)
}

/**
 * 预警
 */
export const http_alarm = {
  page: (params) => postFormData('/zhmsbg/zdProcessTemplate/getWarnPage', params),
  count: (params) => postFormData('/zhmsbg/notice/countWaring', params),
  delete: (id) => post('/zhmsbg/zdProcessTemplate/updateWarnStatus', { id }),
  accurate_alarm_page: (params) => postFormData('/zhmsbg/accurate/getAccurateWarnPageList', params),
  line_alarm_page: (params) => postFormData('/zhmsbg/htGuaranty/queryWarnByPage', params),
  plan_alarm_page: (params) => postFormData('/zhmsbg/htChange/queryWarnByPage', params),
  serve_count: (params) => postFormData('/zhmsbg/notice/countServiceWaring', params),
  accurate_alarm_delete: (id) => post('/zhmsbg/accurate/updateWarnStatus', { id, type: 1 }),
  line_alarm_delete: (id) => post('/zhmsbg/accurate/updateWarnStatus', { id, type: 3 }),
  plan_alarm_delete: (id) => post('/zhmsbg/accurate/updateWarnStatus', { id, type: 2 })
}

/**
 * 中介信息
 */
export const http_intermediary_info = {
  page: (params) => postFormData('/zhmsbg/htIntermediary/queryByPage', params),
  read: (params) => get('/zhmsbg/htIntermediary/queryById', params),
  create: (params) => post('/zhmsbg/htIntermediary/add', params),
  ap_page: (params) => postFormData('/zhmsbg/htIntermediary/getZjEvaluationPage', params),
  set_status: (data) => post('/zhmsbg/htIntermediary/setBlack', data)
}

export const http_intermediary_serveevent = {
  allList: (params) => postFormData('/zhmsbg/htIntermediary/getServiceMatterList', params),
  page: (params) => postFormData('/zhmsbg/htIntermediary/getServiceMatterPageList', params),
  create: (params) => post('/zhmsbg/htIntermediary/addServiceMatter', params),
  delete: (id) => post('/zhmsbg/htIntermediary/deleteServiceMatter', { id })
}

/**
 * 比选业务
 */
export const http_intermediary_bus = {
  page: (params) => postFormData('/zhmsbg/htCompareBusiness/queryByPage', params)
}
export const http_intermediary_serve_bus = {
  page: (params) => postFormData('/zhmsbg/htIntermediaryService/getIntermediaryService', params)
}

/**
 * 中介评价
 */
export const http_intermediary_app = {
  page: (params) => postFormData('/zhmsbg/htEvaluationManagement/queryByPage', params),
  read: (params) => postFormData('/zhmsbg/htEvaluationManagement/ViewComments', params),
  rel: (params) => post('/zhmsbg/htEvaluationManagement/relation', params),
  ap_list: (params) => postFormData('/zhmsbg/htEvaluationManagement/getEvaList', params),
  create: (params) => post('/zhmsbg/IntermediaryEvaluation/addIntermediaryEvent', params)
}

/**
 * 标签
 */
export const http_tag = {
  page: (params) => postFormData('/zhmsbg/label/getPageData', params),
  delete: (id) => post('/zhmsbg/label/deleteById', { id }),
  create: (params) => post('/zhmsbg/label/add', params)
}

/**
 * 轮播
 */
export const http_banner = {
  page: (params) => postFormData('/zhmsbg/barouselInfo/getCarouselPage', params),
  delete: (id) => post('/zhmsbg/barouselInfo/delectCarousel', { id }),
  create: (params) => post('/zhmsbg/barouselInfo/addCarousel', params),
  updateStatus: (params) => post('/zhmsbg/barouselInfo/updateCarouselStatus', params)
}

/**
 * 管理人员
 */
export const http_admin_user = {
  page: (params) => postFormData('/zhmsbg/backstageUser/getUserPage', params),
  delete: (id) => post('/zhmsbg/backstageUser/deleteUser', { id }),
  create: (params) => post('/zhmsbg/backstageUser/addUser', params),
  update: (params) => post('/zhmsbg/backstageUser/updateUserData', params),
  updateStatus: (params) => post('/zhmsbg/backstageUser/updateUserStatus', params),
  updatePermission: (params) => post('/zhmsbg/backstageUser/updatePurview', params),
  getMenus: () => get('/zhmsbg/backstageUser/getBackstageMenu'),
  get_permission: (id) => get('/zhmsbg/backstageUser/getUserMenu', { id })

}

/**
 * 用户
 */
export const http_user = {
  common: {
    page: (params) => postFormData('/zhmsbg/backstageUser/getZbUserPage', params),
    delete: (id) => post('/zhmsbg/backstageUser/deleteUser', { id, type: 1, status: 0 }),
    create: (params) => post('/zhmsbg/backstageUser/addZbUser', params),
    update: (params) => post('/zhmsbg/backstageUser/updateUserData', params),
    updateStatus: (params) => post('/zhmsbg/backstageUser/updateUserStatus', params)
  },
  user2: {
    page: (params) => postFormData('/zhmsbg/backstageUser/getDBUserPage', params),
    delete: (id) => post('/zhmsbg/backstageUser/deleteUser', { id, type: 2, status: 0 }),
    create: (params) => post('/zhmsbg/backstageUser/addZdUser', params),
    update: (params) => post('/zhmsbg/backstageUser/updateZdUserData', params),
    updateStatus: (params) => post('/zhmsbg/backstageUser/updateUserStatus', params)
  },
  user3: {
    page: (params) => postFormData('/zhmsbg/backstageUser/getCKUserPage', params),
    delete: (id) => post('/zhmsbg/backstageUser/deleteUser', { id, type: 3, status: 0 }),
    create: (params) => post('/zhmsbg/backstageUser/addZdUser', params),
    update: (params) => post('/zhmsbg/backstageUser/updateZdUserData', params),
    updateStatus: (params) => post('/zhmsbg/backstageUser/updateUserStatus', params)
  }
}

/**
 * 产品
 */
export const http_product = {
  page: (params) => get('/zhmsbg/ProjectMatterConfig/getMatter', params),
  delete: (id) => post('/zhmsbg/ProductMatter/delProductMatter', { productCode: id }),
  create: (params) => post('/zhmsbg/ProductMatter/addProductMatter', params),
  update: (params) => post('/zhmsbg/ProductMatter/updateProductMatter', params),
  read: (productCode) => postFormData('/zhmsbg/flowLayout/product/queryDetail', { productCode })
}

/**
 * 首页
 */
export const http_home = {
  countInvestProject: () => post('/zhmsbg/statistics/countInvestProject'), // 项目概况、重点项目的统计
  countProjectType: () => post('/zhmsbg/statistics/countProjectType'), // 项目类型分析
  countDistrictProList: () => get('/zhmsbg/statistics/countDistrictProList'), // 统计各镇街道项目分布
  countApproval: () => get('/zhmsbg/statistics/countApproval'), // 审批效率分析
  countService: () => get('/zhmsbg/statistics/countService'), // 代办服务分析
  PageList: (params) => post('/zhmsbg/statistics/getIntermediaryPageList', params), // 分页查询中介列表
  countIntermediary: () => get('/zhmsbg/statistics/countIntermediary'), // 掌上中介分析
  mangerList: () => get('/zhmsbg/statistics/countStageMangerList') // 段长制管理
}
